home *** CD-ROM | disk | FTP | other *** search
- import java.awt.Graphics;
- import java.awt.Point;
- import java.awt.Rectangle;
-
- class CDrawPoly extends CDrawObj {
- protected CPolyline m_polyActual;
- protected CPolyline m_polyDraw;
-
- void Render(Graphics var1, CRect var2, int var3) {
- if (((Rectangle)var2).intersects(((CDrawObj)this).GetDrawRect())) {
- CPolyline var4 = new CPolyline(this.m_polyDraw.xpoints, this.m_polyDraw.ypoints, this.m_polyDraw.npoints);
- super.m_pIconObject.DrawObject(var1, var3, var4);
- }
-
- }
-
- boolean HitTest(Point var1) {
- CPolyline var2 = new CPolyline(this.m_polyDraw.xpoints, this.m_polyDraw.ypoints, this.m_polyDraw.npoints);
- return ((CDrawObj)this).GetDrawRect().inside(var1.x, var1.y) && super.m_pIconObject.HitTestCheck(var1, var2);
- }
-
- CDrawPoly(CIconObject var1, int var2) {
- super(var1, var2);
- CPolyline var3 = var1.GetActualPolyline();
- this.m_polyActual = new CPolyline(var3.xpoints, var3.ypoints, var3.npoints);
- this.m_polyDraw = new CPolyline(this.m_polyActual.xpoints, this.m_polyActual.ypoints, this.m_polyActual.npoints);
- }
-
- void SetFixed() {
- super.m_nFlags &= -257;
- super.m_pSetBy = null;
- }
-
- void MoveTo(Point var1, boolean var2, boolean var3) {
- CRect var4 = new CRect(((CDrawObj)this).GetDrawRect());
- CRect var5 = new CRect(var1.x, var1.y, var4.width, var4.height);
- if (!var3) {
- var5.x -= var4.width / 2;
- var5.y -= var4.height / 2;
- }
-
- if (!((Rectangle)var5).equals(var4)) {
- this.m_polyDraw.MoveBy(var5.x - var4.x, var5.y - var4.y);
- ((CDrawObj)this).SetDrawRect(var5);
- var2 = true;
- }
-
- if (var2) {
- if (((Rectangle)var4).intersects(var5)) {
- var4 = var4.union(var5);
- Globals.thePresView.Render(var4);
- Globals.thePresView.Draw((Graphics)null, var4);
- return;
- }
-
- Globals.thePresView.Render(var4);
- Globals.thePresView.Draw((Graphics)null, var4);
- Globals.thePresView.Render(var5);
- Globals.thePresView.Draw((Graphics)null, var5);
- }
-
- }
- }
-